<template>
  <div>
    <keep-alive exclude="Article,SearchResult">
      <router-view></router-view>
    </keep-alive>
  </div>
</template>

<script>
// 目标:
// 组件被缓存后, created和destroyed不会再次执行了
// 取而代之: activated和deActivated (激活/失去激活)
// 某个组件不重新请求数据问题解决方式
// 1. exclude 不缓存某个组件
// 2. created换成activated即可
import { getChannelListAPI } from '@/api'
export default {
  async created () {
    try {
      const res = await getChannelListAPI()
      console.log(res)
    } catch (err) {
      console.log(err)
    }
  }
}
</script>

<style scoped>

</style>
